package nz.ac.massey.doi_information_extractor.gui;

import java.io.File;
import javax.swing.filechooser.FileFilter;

public class DbFileFilter extends FileFilter {

    private String description;
    private String extension;

	public DbFileFilter(){
		this.extension = ".db";
		this.description = "Database File (*.db)";
	}

	public boolean accept(File file) {
        if (file == null) {
            return false;
        }


        return file.isDirectory() || file.getName().toLowerCase().endsWith(extension);
	}

    public String getDescription() {
        return description;
    }
}
